; ;; Add emacs groups
; GroupAdd, Emacs, ahk_class Emacs ; emacs
; GroupAdd, Emacs, ahk_exe WindowsTerminal.exe ; windows terminal
; Return

; #IfWinActive ahk_group Emacs  	; if in emacs
; +Capslock::Capslock 			; make shift+Caps-Lock the Caps Lock toggle
; Capslock::Control   			; make Caps Lock the control button
; ^Space::Send, {F7}mm ;(F7 m m), mark set for emacs
; #IfWinActive        			; end if in emacs

!+y::
Clipboard := ""
Send ^c
ClipWait  ; Wait for the clipboard to contain text.
ClipSaved := Clipboard   ; Save the entire clipboard to a variable of your choice.
ClipSaved := RegExReplace(ClipSaved, "\s*\w+\s+[\w\.<>]+\s+(\w+)\s*\{\s*.+\s*\}(\r?\n?)", "yield return $1;$2")
Clipboard := ClipSaved   ; Restore the original clipboard. Note the use of Clipboard (not ClipboardAll).
ClipSaved := ""   ; Free the memory in case the clipboard was very large.